package com.optitronics.ui;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;

import com.optitronics.beans.OrderItem;
import com.optitronics.util.OptitronicsConstants;

public class OrderItemDisplayForm {
	private Integer id;

	private String productName;

	private String resellerName;

	private String orderDate;

	private Integer quantity;

	private BigDecimal amountWithoutTax;

	private BigDecimal amountWithTax;

	private String orderTypeString;

	public OrderItemDisplayForm() {

	}

	public OrderItemDisplayForm(OrderItem orderItem) {
		this.id = orderItem.getId();
		this.productName = orderItem.getProductName();
		this.resellerName = orderItem.getResellerOrder().getReseller().getName();
		SimpleDateFormat dateFormat = new SimpleDateFormat(OptitronicsConstants.DATE_FORMAT);
		this.orderDate = dateFormat.format(orderItem.getResellerOrder().getOrderDate());
		this.quantity = orderItem.getQuantity();
		this.amountWithoutTax = orderItem.getAmountWithoutTax();
		this.amountWithTax = orderItem.getAmountWithTax();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getResellerName() {
		return resellerName;
	}

	public void setResellerName(String resellerName) {
		this.resellerName = resellerName;
	}

	public String getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public BigDecimal getAmountWithoutTax() {
		return amountWithoutTax;
	}

	public void setAmountWithoutTax(BigDecimal amountWithoutTax) {
		this.amountWithoutTax = amountWithoutTax;
	}

	public BigDecimal getAmountWithTax() {
		return amountWithTax;
	}

	public void setAmountWithTax(BigDecimal amountWithTax) {
		this.amountWithTax = amountWithTax;
	}

}
